package com.epam.training.myspringioc;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Contain bean property and constructor arguments
 * 
 * @author bogdan
 *
 */
public class BeanDefinition {
	private String classId;
	private Map<String, String> constructorArgs;
	private Map<String, String[]> properties;

	public BeanDefinition() {
		constructorArgs = new LinkedHashMap<String, String>();
		properties = new LinkedHashMap<String, String[]>();
	}

	public Map<String, String> getConstructorArgs() {
		return constructorArgs;
	}

	public Map<String, String[]> getProperties() {
		return properties;
	}

	public String getClassId() {
		return classId;
	}

	public void setClassId(String classId) {
		this.classId = classId;
	}

	public void addConstructorArg(String argName, String arg) {
		constructorArgs.put(argName, arg);
	}

	public void addProperty(String tagName, String[] atribute) {
		properties.put(tagName, atribute);
	}

	@Override
	public String toString() {
		return "BeanDefinition [classId=" + classId + ", constructorArgs="
				+ Arrays.toString(constructorArgs.keySet().toArray())
				+ Arrays.toString(constructorArgs.values().toArray())
				+ ", properties="
				+ Arrays.toString(properties.keySet().toArray())
				+ Arrays.deepToString(properties.values().toArray()) + "]";
	}
}
